#RequireAdmin
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=..\Resources\Icons\Install-Green.ico
#AutoIt3Wrapper_Outfile=Distribute\Get-App Config Checker.exe
#AutoIt3Wrapper_UseX64=n
#AutoIt3Wrapper_Change2CUI=y
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
$iniFile = "Get-App.conf"
$dataPort = "277"
$filePort = "438"
$latest = True
$Name = ""
$Version = ""
$uri = ""
Global $apiType = "Undefined"
SplashScreen()
ConsoleWrite(" Checking..." & @CRLF)
checkINI()
Sleep("10000")
Func checkINI()
	if FileExists("C:\Windows\" & $iniFile) Then
		$file = "C:\Windows\" & $iniFile
		$server = IniRead($iniFile,"Config","Server","Undefined")
		$dataPort = IniRead($iniFile,"Config","Data Port","Undefined")
		$filePort = IniRead($iniFile,"Config","File Port","Undefined")
	ElseIf FileExists($iniFile) Then
		$file = $iniFile
		$server = IniRead($iniFile,"Config","Server","Undefined")
		$dataPort = IniRead($iniFile,"Config","Data Port","Undefined")
		$filePort = IniRead($iniFile,"Config","File Port","Undefined")
	ElseIf FileExists(@ScriptDir & "\" & $iniFile) Then
		$file = @ScriptDir & "\" & $iniFile
		$server = IniRead($iniFile,"Config","Server","Undefined")
		$dataPort = IniRead($iniFile,"Config","Data Port","Undefined")
		$filePort = IniRead($iniFile,"Config","File Port","Undefined")
	EndIf
	ConsoleWrite(" " & @CRLF)
	ConsoleWrite(" Server:" & @TAB & $server & @CRLF)
	ConsoleWrite(" Data Port:" & @TAB  & $dataPort & @CRLF)
	ConsoleWrite(" File Port:" & @TAB  & $filePort & @CRLF)
	ConsoleWrite(" Config File:" & @TAB  & $file & @CRLF)
	ConsoleWrite(" " & @CRLF)
	ConsoleWrite(" " & @CRLF)
	ConsoleWrite(" " & @CRLF)
EndFunc
Func SplashScreen()
	ConsoleWrite(" " & @CRLF)
	ConsoleWrite(" " & @CRLF)
	ConsoleWrite(" " & @CRLF)
	ConsoleWrite("   /$$$$$$              /$$           /$$$$$$                     " & @CRLF)
	ConsoleWrite("  /$$__  $$            | $$          /$$__  $$                    " & @CRLF)
	ConsoleWrite(" | $$  \__/  /$$$$$$  /$$$$$$       | $$  \ $$  /$$$$$$   /$$$$$$ " & @CRLF)
	ConsoleWrite(" | $$ /$$$$ /$$__  $$|_  $$_//$$$$$$| $$$$$$$$ /$$__  $$ /$$__  $$" & @CRLF)
	ConsoleWrite(" | $$|_  $$| $$$$$$$$  | $$ |______/| $$__  $$| $$  \ $$| $$  \ $$" & @CRLF)
	ConsoleWrite(" | $$  \ $$| $$_____/  | $$ /$$     | $$  | $$| $$  | $$| $$  | $$" & @CRLF)
	ConsoleWrite(" |  $$$$$$/|  $$$$$$$  |  $$$$/     | $$  | $$| $$$$$$$/| $$$$$$$/" & @CRLF)
	ConsoleWrite("  \______/  \_______/   \___/       |__/  |__/| $$____/ | $$____/ " & @CRLF)
	ConsoleWrite("                                              | $$      | $$      " & @CRLF)
	ConsoleWrite("                                              | $$      | $$      " & @CRLF)
	ConsoleWrite("            Config Checker                    |__/      |__/  " & @CRLF)
	ConsoleWrite(" " & @CRLF)
	ConsoleWrite("                                                      -by Jo" & @CRLF)
	ConsoleWrite(" " & @CRLF)
	ConsoleWrite(" " & @CRLF)
	ConsoleWrite(" " & @CRLF)
	ConsoleWrite(" " & @CRLF)
	Sleep("1000")
EndFunc
